package com.zlcx.tz.live.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.io.Serializable;
import java.util.Date;

/**
 * @author anjl
 * @date 1:02 PM 2019/4/15
 * description:
 */
@Data
@Entity(name = "tz_api_request_statistics")
@NoArgsConstructor
@AllArgsConstructor
@Builder
@DynamicUpdate
@DynamicInsert
public class ApiRequestStatisticsDO implements Serializable {

    private static final long serialVersionUID = 951336782253942473L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 日期
     */
    private String day;

    /**
     * 请求方法 POST,GET,PUT,DELETE
     */
    private String method;

    /**
     * 接口地址
     */
    private String url;

    /**
     * 请求成功总次数
     */
    private Long count;

    /**
     * 错误请求总次数
     */
    private Long errorCount;

    /**
     * 请求总耗时
     */
    private Long millisecond;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createTime;

    /**
     * 修改时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date updateTime;


}
